import pygame, sys, random#导入模块
from pygame.examples.video import backgrounds

pygame.init()#模块初始化
screen = pygame.display.set_mode((600,600))#设置窗口大小
pygame.display.set_caption("围棋")#设置窗口标题
#加载背景图片
backgrounds = pygame.image.load("images\\围棋棋盘背景.jpg")
screen.blit(backgrounds,(0,0))
FPS = 30
fpsClock = pygame.time.Clock()
for i in  range(19):
    pygame.draw.line(screen,"Black",[30, 30 + i * 30],
                     [570, 30 + i * 30]  ,2 )
    pygame.display.update()
    fpsClock.tick(FPS)
    for i in range(19):
        pygame.draw.line(screen, "Black", [30, 30 + i * 30],
                         [570, 30 + i * 30], 2)
        pygame.display.update()
        fpsClock.tick(FPS)
    for i in range(3):
        for j in range(3):
         pygame.draw.circle(screen, "Black",
                           [120 + 180 * i, 120 + 180 * j], 5)
         pygame.display.update()
         fpsClock.tick(FPS)
    for i in range(5):
        pos = [random.randint(1, 19) * 30, random.randint(1, 19) * 30]
        pygame.draw.circle(screen, random.choice(["Black", "White"]),
                           pos, 15)
        pygame.display.update()
        fpsClock.tick(FPS)
    while True:
        for event in pygame.event.get():
            if event.type == pygame.QUIT:
                pygame.quit()
                sys.exit()





